<template>
  <!--此为评分组件-->
  <exam-rate
    v-if="paper_exam_result"
    :exam_result="paper_exam_result"
    :paper_info="paper_config.paper_info"
  />

  <!-- 考试页面 -->
  <div v-else class="paper_exam">
    <div
      class="container"
      v-if="
        paper_config.paper_info.paper_id ||
        (paper_config.paper_info.st_list &&
          paper_config.paper_info.st_list.length !== 0)
      "
    >
      <!--勿随意改动-->
      <div class="mt-20 pl-20 c-666">
        <span class="md fz16 align-y-top mr-4">content_copy</span>
        {{ paper_config.paper_info.lb }} / {{ paper_config.paper_info.sj_name }}
      </div>

      <Row :gutter="15" class="mt-20">
        <Col span="17-5">
          <!--#start 试题暂停mask-->
          <div class="exam-pause-mask" v-show="count_down.is_pause">
            <span
              class="mb icon-gesture-timer mr-16 pos-fixed y-center"
              style="
                font-size: 100px;
                animation: opacity-reverse 2s infinite;
                margin-left: 390px;
              "
            ></span>
          </div>
          <div class="p-panel paper-main">
            <div class="text-center paper-info">
              <div class="fz20 fw-bold">
                {{ paper_config.paper_info.sj_name }}
              </div>
              <div class="c-aaa mt-8">
                单项选择题{{ paper_config.single_Q_info.zs }}题，共{{
                  paper_config.single_Q_info.fz
                }}分; 多项选择题{{ paper_config.multiple_Q_info.zs }}题，共{{
                  paper_config.multiple_Q_info.fz
                }}分;材料题{{
                  paper_config.stuff_info != undefined &&
                  paper_config.stuff_info !== "无"
                    ? paper_config.stuff_info.zs
                    : "0"
                }}题，共{{
                  paper_config.stuff_info != undefined &&
                  paper_config.stuff_info !== "无"
                    ? paper_config.stuff_info.fz
                    : "0"
                }}分; 总计{{
                paper_config.paper_info.zf
                }}分。
              </div>
            </div>
            <!--单选题-->
            <div
              class="Q-panel pos-rel"
              v-if="
                paper_config.single_Q_json &&
                paper_config.single_Q_json.length !== 0
              "
            >
              <div class="Q-info bg-0084B3 fz14 c-fff">
                单项选择题（{{ paper_config.single_Q_info.zs }}题，{{
                  paper_config.single_Q_info.fz
                }}分）
              </div>
              <div>
                <!-- 单选 子组件 -->
                <single-Q
                  @changeTime="changeTime"
                  class="cmm"
                  v-for="(item, index) in paper_config.single_Q_json"
                  :key="index"
                  :Q="item"
                  :id="'single' + item.xh"
                  :request_id="request_id"
                  :colectId="colectId"
                  :bXlId="bXlId"
                  :startRun="startRun"
                />
              </div>
            </div>
          </div>
          <!--多选题 , 分离panel-->
          <div
            class="p-panel mt-10 Q-panel pos-rel"
            v-if="
              paper_config.multiple_Q_json &&
              paper_config.multiple_Q_json.length !== 0
            "
          >
            <div class="Q-info bg-0084B3 fz14 c-fff">
              多项选择题（{{ paper_config.multiple_Q_info.zs }}题，{{
                paper_config.multiple_Q_info.fz
              }}分）
            </div>
            <div>
              <!-- 多选 子组件 -->
              <multiple-Q
                class="cmm"
                v-for="(item, index) in paper_config.multiple_Q_json"
                :key="index"
                :Q="item"
                :id="'multiple' + item.xh"
                :request_id="request_id"
                :colectId="colectId"
                :bXlId="bXlId"
                :startRun="startRun"
                @changeTime="changeTime"
              />
            </div>
          </div>
          <!--材料题 , 分离panel-->
          <div
            class="p-panel mt-10 Q-panel pos-rel"
            v-if="
              paper_config.stuff_Q_json &&
              paper_config.stuff_Q_json.length !== 0
            "
          >
            <div class="Q-info bg-0084B3 fz14 c-fff">
              材料题（{{ paper_config.stuff_info.zs }}题，{{
                paper_config.stuff_info.fz
              }}分）
            </div>
            <div>
              <!-- 材料 子组件 -->
              <stuff-Q
                class="cmm"
                v-for="(item, index) in paper_config.stuff_Q_json"
                :key="index"
                :Q="item"
                :id="'stuff' + item.xh"
                :request_id="request_id"
                :colectId="colectId"
                :bXlId="bXlId"
                :startRun="startRun"
              />
            </div>
          </div>
          <!--提交 用来记录做题时间 但是不在页面显示-->
          <div
            class="bg-fff pt-14 pos-rel text-center clearfix"
            style="padding-bottom: 30px; display: none"
          >
            <div class="pass-time fz20 c-5e5e5e float-left">
              <span
                class="mb icon-gesture-timer mr-4 ml-40"
                style="font-size: 40px; vertical-align: -7px"
              ></span>
              已用时
              {{ text_pass_time }}
            </div>
            <Button
              shape="circle"
              class="pos-abs x-center solid-0084b3 fz16 p-y-6-5"
              style="width: 200px"
              @click="on_submit"
            >
              马上交卷
            </Button>
          </div>
        </Col>

        <!-- 序号 -->
        <Col span="6-5">
          <div class="sub-main" :class="{ fixed: scrollNum > 200 }">
            <div class="p-panel Q-index-panel clearfix">
              <div class="jsq">
                <div class="left">
                  <a></a>
                  <span>计时器</span>
                </div>
                <div v-if="this.$route.params.st_lx != '5'">
                  <div
                    @click="pause_count_down"
                    class="right"
                    v-if="count_down.use"
                  >
                    <span class="fz14 buton">暂停 </span>
                    <img src="../component/img/ic_tk_zanting@2x.png" alt="" />
                  </div>
                  <div @click="start_count_down" class="right" v-else>
                    <span class="fz14 buton"> 继续 </span>
                    <img src="../component/img/ic_tk_jixu@2x.png" alt="" />
                  </div>
                </div>
              </div>
              <div
                v-if="this.$route.params.st_lx != '5'"
                class="fz28 count-down"
              >
                <span>{{ text_remaining_time.h }}</span
                >: <span>{{ text_remaining_time.m }}</span
                >:
                <span>{{ text_remaining_time.s }}</span>
              </div>
              <div v-else class="fz28 count-down">
                <!-- <m-day
                  @submitPaper="submitPaper"
                  :startTime="wr_obj.end_time"
                ></m-day> -->

                   <m-day
                   v-if="wr_obj.major=='经济'"
                  @submitPaper="submitPaper"
                  :startTime="examEnd.jTime"
                ></m-day>
                    <m-day
                    v-else-if="wr_obj.major=='法规'"
                  @submitPaper="submitPaper"
                  :startTime="examEnd.fTime"
                ></m-day>
                    <m-day
                    v-else-if="wr_obj.major=='管理'"
                  @submitPaper="submitPaper"
                  :startTime="examEnd.gTime"
                ></m-day>
                    <m-day
                    v-else-if="wr_obj.major=='市政'"
                  @submitPaper="submitPaper"
                  :startTime="examEnd.sTime"
                ></m-day>
                    <m-day
                    v-else-if="wr_obj.major=='建筑'"
                  @submitPaper="submitPaper"
                  :startTime="examEnd.zTime"
                ></m-day>

              </div>

              <!-- <div class="c-aaa text-center mt-6 fz12">
                单击题号可快速切换题目
              </div> -->

              <div class="xhlist" v-if="paper_config">
                <div class="xhlist-text">
                  <a></a>
                  <span>答题卡</span>
                </div>

                <div class="xh-list browser-scroll1">
                  <div
                    class="t_xh"
                    v-if="
                      paper_config.single_Q_json &&
                      paper_config.single_Q_json.length !== 0
                    "
                  >
                    <span>单选题</span>
                    <ul class="ul-tabs Q-index-list mt-8">
                      <!--前提 单选 多选 序号不乱-->
                      <li
                        v-for="(item, index) in paper_config.single_Q_json"
                        :key="'single' + index"
                        :class="{ dirty: item.yx_da.length !== 0 }"
                        @click="scroll2dom('#single' + item.xh)"
                      >
                        {{ item.xh }}
                      </li>
                    </ul>
                  </div>
                  <div
                    class="t_xh"
                    v-if="
                      paper_config.multiple_Q_json.length &&
                      paper_config.multiple_Q_json.length !== 0
                    "
                  >
                    <span>多选题</span>
                    <ul class="ul-tabs Q-index-list mt-8">
                      <li
                        v-for="(item, index) in paper_config.multiple_Q_json"
                        :key="'multiple' + index"
                        :class="{ dirty: item.yx_da.length !== 0 }"
                        @click="scroll2dom('#multiple' + item.xh)"
                      >
                        {{ item.xh }}
                      </li>
                    </ul>
                  </div>
                  <div
                    class="t_xh"
                    v-if="
                      paper_config.stuff_Q_json &&
                      paper_config.stuff_Q_json.length !== 0
                    "
                  >
                    <span>材料题</span>
                    <ul class="ul-tabs Q-index-list mt-8">
                      <li
                        v-for="(item, index) in paper_config.stuff_Q_json"
                        :key="'stuff' + index"
                        :class="{ dirty: item.yx_da.length !== 0 }"
                        @click="scroll2dom('#stuff' + item.xh)"
                      >
                        {{ item.xh }}
                      </li>
                    </ul>
                  </div>
                </div>
                <Button class="submitbtn" @click="on_submit(1)">
                  马上交卷
                </Button>
              </div>
            </div>
          </div>
        </Col>
      </Row>
    </div>
    <!-- 暂无数据 -->
    <div class="no-data" v-else></div>
    <!--交卷提示 modal-->

    <my-modal1 class="submit-tip-modal" v-model="submit_tip_modal.use">
      <div slot="header" style="font-weight: 600">温馨提示</div>
      <div
        slot="contentt"
        style="margin-bottom: 10px; font-weight: 600"
        class="text-center"
      >
        交卷提示
      </div>
      <div slot="content" class="text-center">
        本次测试还有{{ submit_tip_modal.not_compile_Q_num }}道题目未作答 !
      </div>

      <div
        slot="footer"
        class="clearfix"
        style="
          margin-top: 27px;
          display: flex;
          align-items: center;
          justify-content: center;
        "
        v-show="subBtn"
      >
        <Button
          shape="circle"
          class="btn-sunmit"
          @click="submit"
          style="margin-right: 30px"
        >
          确认交卷
        </Button>
        <Button
          shape="circle"
          class="btn-sunmit btn-right"
          @click="submit_tip_modal.use = false"
        >
          继续答题
        </Button>
      </div>
    </my-modal1>
    <!-- 自动胶卷提示 -->
     <my-modal2 class="submit-tip-modal2" v-model="autoSubmit">
      <div
        slot="contentt"
        style="margin-bottom: 10px; font-weight: 600"
        class="text-center"
      >
        交卷提示
      </div>
      <div slot="content"  class="text-center">
        考试结束，系统正在自动交卷...
      </div>
    </my-modal2>
  </div>
</template>

<script src="./this.js">
</script>

<style scoped lang="scss" src="./this.scss">
</style>
